#!/bin/bash
rm -rf xtime
Dir_process=`pwd`

listcom=$1   #a list for 4K*4K CCD images with the same field

if [ $# -ne 1  ]
then
	echo "usage:  xbmatch.sh listcom(a list for 4K*4K CCD images with the same field)"
fi


rm -rf list_*
date >>xtime
echo "xstackimg_xy.sh" >>xtime
#xstackimg_xy.sh $listcom
xstackimg_qiu.sh $listcom
date>>xtime
cd $Dir_process
ls *_c.fit >limit.lst
listcom=limit.lst
if test ! -s $listcom
then
	echo "no any combined image in this process"
	exit 0
fi
echo "xsplite_list.sh" >>xtime
xsplite_list.sh $listcom
cd $Dir_process
date>>xtime
echo "xlimit_list.sh" >>xtime
ls *s.fit >limit.lst
xlimit_list.sh limit.lst
wait
date>>xtime
cd $Dir_process
echo "xfindglade_list.sh" >>xtime
xfindglade_list.sh limit.lst
wait
date>>xtime
#cd $Dir_process
#echo "xfindgalaxy_list.sh" >>xtime
#xfindgalaxy_list.sh limit.lst 
#wait
cd $Dir_process
xot_list.sh limit.lst
wait

date>>xtime
echo "All are over"
